import React from "react";
import { Button } from "antd";
import { useTranslation } from "react-i18next";
import DragBox from "@/components/DragBox";

const dragBoxStyle = { left: "70vw", top: "90vh" };
const ChangeLanguage = () => {
  const { i18n } = useTranslation();
  return (
    <DragBox style={dragBoxStyle}>
      <Button
        onClick={() =>
          i18n.languages[0] === "en"
            ? i18n.changeLanguage("zh")
            : i18n.changeLanguage("en")
        }
      >
        <span style={{ width: "80px" }}>
          切换语言{i18n.languages[0] === "en" ? "zh" : "en"}
        </span>
      </Button>
    </DragBox>
  );
};

export default ChangeLanguage;
